
//  Leadsv.m
//  LCKJDS
//
//  Created by 胡品 on 16/5/23.
//  Copyright © 2016年 LCKJ. All rights reserved.
//

#import "Leadsv.h"
#import "LeadViewController.h"
#import "TechnicianTabbarVC.h"

@implementation Leadsv

-(Leadsv*)init
{
    self = [super init];
    
    if (self) {
        self.contentSize =CGSizeMake([UIScreen mainScreen].bounds.size.width * 5, 0);
        self.showsHorizontalScrollIndicator=NO;
        self.showsVerticalScrollIndicator=NO;
        self.pagingEnabled=YES;
    }
    return self;
}

-(void)preshImage:(NSArray*)arr//总共有多少张
{
    for (int i=0; i<arr.count; i++) {
        UIImageView * imageview = [[UIImageView alloc]init];
        imageview.frame=CGRectMake([UIScreen mainScreen].bounds.size.width*i, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
        
        [imageview setImage:arr[i]];
        
        [self addSubview:imageview];
        
    }
}

- (void)fun:(UIButton *)sender{
    
    [[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"string"];
    UIWindow * window=[UIApplication sharedApplication].keyWindow;
    TechnicianTabbarVC  * login=[[TechnicianTabbarVC alloc]init];
    window.rootViewController =login;
    [window makeKeyAndVisible];
    
}

-(void)ScrollImageCount:(int)count
{
    for (int i=0; i<count; i++) {
        UIImageView * imageview=[[UIImageView alloc]init];
        imageview.frame=CGRectMake([UIScreen mainScreen].bounds.size.width*i, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
        [imageview setImage:[UIImage imageNamed:[NSString stringWithFormat:@"LeadIMap%d.png",i]]];
     
        [self addSubview:imageview];
    }
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"string"];
    UIWindow * window=[UIApplication sharedApplication].keyWindow;
    TechnicianTabbarVC  * login=[[TechnicianTabbarVC alloc]init];
    window.rootViewController =login;
    [window makeKeyAndVisible];
    
}



@end
